import 'package:flutter/material.dart';
import 'package:ost_flutter_module/common/color.dart';

class GScaffold extends StatelessWidget {
  final AppBar appBar;
  final Widget title, body, bottomNavigationBar;
  final List<Widget> actions;
  const GScaffold(
      {Key key,
      this.title,
      this.body,
      this.bottomNavigationBar,
      this.appBar,
      this.actions})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: appBar ??
          AppBar(
            title: title ?? Container(),
            actions: actions,
            iconTheme: IconThemeData(color: color303030),
            backgroundColor: primaryColor,
            elevation: 0,
          ),
      body: body,
      bottomNavigationBar: bottomNavigationBar,
      resizeToAvoidBottomInset: true, // 防止键盘弹出会把整个页面顶上去
    );
  }
}
